//
//  ZMZSGuanyuViewController.m
//  ZhangMiZhuShou
//
//  Created by ryou on 2021/7/26.
//

#import "ZMZSGuanyuViewController.h"
#define kzmxzsTitles @[@"版本 V1.0",@"分享好友",@"隐私政策",@"给我们评分",@"意见反馈"]
@interface ZMZSGuanyuViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *ZMXZSTableView;

@end

@implementation ZMZSGuanyuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.ZMXZSTableView.delegate=self;
    self.ZMXZSTableView.dataSource=self;
    self.ZMXZSTableView.tableFooterView=[[UIView alloc]init];
    self.ZMXZSTableView.backgroundColor=kZMXZSMainColor;
    self.ZMXZSTableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    // Do any additional setup after loading the view from its nib.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    UITableViewCell *zmzsCell=[tableView cellForRowAtIndexPath:indexPath];
    if (!zmzsCell) {
        zmzsCell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"zmzscellid"];
    }
    UIImageView *cellbg=[[UIImageView alloc]initWithFrame:CGRectMake(0, 10, kZMXZSWidth, 80)];
    cellbg.image=[UIImage imageNamed:@"zmxzs_btn_bg.png"];
    cellbg.contentMode = UIViewContentModeScaleToFill;
    [zmzsCell addSubview:cellbg];
    zmzsCell.selectionStyle=UITableViewCellSelectionStyleNone;
    zmzsCell.backgroundColor=kZMXZSMainColor;
    zmzsCell.textLabel.text = kzmxzsTitles[indexPath.row];
    zmzsCell.textLabel.textColor =[UIColor grayColor];
    if (indexPath.row>0) {
        zmzsCell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    }
    return zmzsCell;
}

- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}
 
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row>0) {
        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://shimo.im/docs/PqT833RXd9W3PCvv"] options:@{} completionHandler:nil];
    }
}
@end
